3.3.69 \(\int (a+\frac {b}{x})^p (c+\frac {d}{x})^q \, dx\) [269]

Optimal. Leaf size=96 \[ -\frac {b \left (a+\frac {b}{x}\right )^{1+p} \left (c+\frac {d}{x}\right )^q \left (\frac {b \left (c+\frac {d}{x}\right )}{b c-a d}\right )^{-q} F_1\left (1+p;-q,2;2+p;-\frac {d \left (a+\frac {b}{x}\right )}{b c-a d},\frac {a+\frac {b}{x}}{a}\right )}{a^2 (1+p)} \]

[Out]

-b*(a+b/x)^(1+p)*(c+d/x)^q*AppellF1(1+p,2,-q,2+p,(a+b/x)/a,-d*(a+b/x)/(-a*d+b*c))/a^2/(1+p)/((b*(c+d/x)/(-a*d+
b*c))^q)

________________________________________________________________________________________

Rubi [A]
time = 0.05, antiderivative size = 96, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 3, integrand size = 19, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.158, Rules used = {382, 142, 141} \begin {gather*} -\frac {b \left (a+\frac {b}{x}\right )^{p+1} \left (c+\frac {d}{x}\right )^q \left (\frac {b \left (c+\frac {d}{x}\right )}{b c-a d}\right )^{-q} F_1\left (p+1;-q,2;p+2;-\frac {d \left (a+\frac {b}{x}\right )}{b c-a d},\frac {a+\frac {b}{x}}{a}\right )}{a^2 (p+1)} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[(a + b/x)^p*(c + d/x)^q,x]

[Out]

-((b*(a + b/x)^(1 + p)*(c + d/x)^q*AppellF1[1 + p, -q, 2, 2 + p, -((d*(a + b/x))/(b*c - a*d)), (a + b/x)/a])/(
a^2*(1 + p)*((b*(c + d/x))/(b*c - a*d))^q))

Rule 141

Int[((a_) + (b_.)*(x_))^(m_)*((c_.) + (d_.)*(x_))^(n_)*((e_.) + (f_.)*(x_))^(p_), x_Symbol] :> Simp[(b*e - a*f
)^p*((a + b*x)^(m + 1)/(b^(p + 1)*(m + 1)*(b/(b*c - a*d))^n))*AppellF1[m + 1, -n, -p, m + 2, (-d)*((a + b*x)/(
b*c - a*d)), (-f)*((a + b*x)/(b*e - a*f))], x] /; FreeQ[{a, b, c, d, e, f, m, n}, x] &&  !IntegerQ[m] &&  !Int
egerQ[n] && IntegerQ[p] && GtQ[b/(b*c - a*d), 0] &&  !(GtQ[d/(d*a - c*b), 0] && SimplerQ[c + d*x, a + b*x])

Rule 142

Int[((a_) + (b_.)*(x_))^(m_)*((c_.) + (d_.)*(x_))^(n_)*((e_.) + (f_.)*(x_))^(p_), x_Symbol] :> Dist[(c + d*x)^
FracPart[n]/((b/(b*c - a*d))^IntPart[n]*(b*((c + d*x)/(b*c - a*d)))^FracPart[n]), Int[(a + b*x)^m*(b*(c/(b*c -
 a*d)) + b*d*(x/(b*c - a*d)))^n*(e + f*x)^p, x], x] /; FreeQ[{a, b, c, d, e, f, m, n}, x] &&  !IntegerQ[m] &&
 !IntegerQ[n] && IntegerQ[p] &&  !GtQ[b/(b*c - a*d), 0] &&  !SimplerQ[c + d*x, a + b*x]

Rule 382

Int[((a_) + (b_.)*(x_)^(n_))^(p_.)*((c_) + (d_.)*(x_)^(n_))^(q_.), x_Symbol] :> -Subst[Int[(a + b/x^n)^p*((c +
 d/x^n)^q/x^2), x], x, 1/x] /; FreeQ[{a, b, c, d, p, q}, x] && NeQ[b*c - a*d, 0] && ILtQ[n, 0]

Rubi steps

\begin {align*} \int \left (a+\frac {b}{x}\right )^p \left (c+\frac {d}{x}\right )^q \, dx &=-\text {Subst}\left (\int \frac {(a+b x)^p (c+d x)^q}{x^2} \, dx,x,\frac {1}{x}\right )\\ &=-\left (\left (\left (c+\frac {d}{x}\right )^q \left (\frac {b \left (c+\frac {d}{x}\right )}{b c-a d}\right )^{-q}\right ) \text {Subst}\left (\int \frac {(a+b x)^p \left (\frac {b c}{b c-a d}+\frac {b d x}{b c-a d}\right )^q}{x^2} \, dx,x,\frac {1}{x}\right )\right )\\ &=-\frac {b \left (a+\frac {b}{x}\right )^{1+p} \left (c+\frac {d}{x}\right )^q \left (\frac {b \left (c+\frac {d}{x}\right )}{b c-a d}\right )^{-q} F_1\left (1+p;-q,2;2+p;-\frac {d \left (a+\frac {b}{x}\right )}{b c-a d},\frac {a+\frac {b}{x}}{a}\right )}{a^2 (1+p)}\\ \end {align*}

________________________________________________________________________________________

Mathematica [B] Leaf count is larger than twice the leaf count of optimal. \(206\) vs. \(2(96)=192\).
time = 0.30, size = 206, normalized size = 2.15 \begin {gather*} \frac {b d (-2+p+q) \left (a+\frac {b}{x}\right )^p \left (c+\frac {d}{x}\right )^q x F_1\left (1-p-q;-p,-q;2-p-q;-\frac {a x}{b},-\frac {c x}{d}\right )}{(-1+p+q) \left (-b d (-2+p+q) F_1\left (1-p-q;-p,-q;2-p-q;-\frac {a x}{b},-\frac {c x}{d}\right )+x \left (a d p F_1\left (2-p-q;1-p,-q;3-p-q;-\frac {a x}{b},-\frac {c x}{d}\right )+b c q F_1\left (2-p-q;-p,1-q;3-p-q;-\frac {a x}{b},-\frac {c x}{d}\right )\right )\right )} \end {gather*}

Warning: Unable to verify antiderivative.

[In]

Integrate[(a + b/x)^p*(c + d/x)^q,x]

[Out]

(b*d*(-2 + p + q)*(a + b/x)^p*(c + d/x)^q*x*AppellF1[1 - p - q, -p, -q, 2 - p - q, -((a*x)/b), -((c*x)/d)])/((
-1 + p + q)*(-(b*d*(-2 + p + q)*AppellF1[1 - p - q, -p, -q, 2 - p - q, -((a*x)/b), -((c*x)/d)]) + x*(a*d*p*App
ellF1[2 - p - q, 1 - p, -q, 3 - p - q, -((a*x)/b), -((c*x)/d)] + b*c*q*AppellF1[2 - p - q, -p, 1 - q, 3 - p -
q, -((a*x)/b), -((c*x)/d)])))

________________________________________________________________________________________

Maple [F]
time = 0.04, size = 0, normalized size = 0.00 \[\int \left (a +\frac {b}{x}\right )^{p} \left (c +\frac {d}{x}\right )^{q}\, dx\]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a+1/x*b)^p*(c+d/x)^q,x)

[Out]

int((a+1/x*b)^p*(c+d/x)^q,x)

________________________________________________________________________________________

Maxima [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Failed to integrate} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b/x)^p*(c+d/x)^q,x, algorithm="maxima")

[Out]

integrate((a + b/x)^p*(c + d/x)^q, x)

________________________________________________________________________________________

Fricas [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b/x)^p*(c+d/x)^q,x, algorithm="fricas")

[Out]

integral(((a*x + b)/x)^p*((c*x + d)/x)^q, x)

________________________________________________________________________________________

Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \left (a + \frac {b}{x}\right )^{p} \left (c + \frac {d}{x}\right )^{q}\, dx \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b/x)**p*(c+d/x)**q,x)

[Out]

Integral((a + b/x)**p*(c + d/x)**q, x)

________________________________________________________________________________________

Giac [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b/x)^p*(c+d/x)^q,x, algorithm="giac")

[Out]

integrate((a + b/x)^p*(c + d/x)^q, x)

________________________________________________________________________________________

Mupad [F]
time = 0.00, size = -1, normalized size = -0.01 \begin {gather*} \int {\left (a+\frac {b}{x}\right )}^p\,{\left (c+\frac {d}{x}\right )}^q \,d x \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a + b/x)^p*(c + d/x)^q,x)

[Out]

int((a + b/x)^p*(c + d/x)^q, x)

________________________________________________________________________________________